package com.houzhijun.client.task;

import com.houzhijun.client.listener.MessageListenerMulticaster;
import com.houzhijun.common.contant.IMRedisKey;
import com.houzhijun.common.enums.IMListenerType;
import com.houzhijun.common.model.IMSendResult;
import com.houzhijun.common.mq.RedisMQListener;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@RequiredArgsConstructor
@RedisMQListener(queue = IMRedisKey.IM_RESULT_SYSTEM_QUEUE, batchSize = 100)
public class SystemMessageResultResultTask extends AbstractMessageResultTask<IMSendResult> {

    private final MessageListenerMulticaster listenerMulticaster;

    @Override
    public void onMessage(List<IMSendResult> results) {
        listenerMulticaster.multicast(IMListenerType.SYSTEM_MESSAGE, results);
    }

}
